Read data file.

## [1] "Columns: patient_id, encounter_id, admitted_dt_tm, age_in_years, age_in_days, patient_type_id, loinc_code, accession, lab_procedure_id, lab_procedure_mnemonic, unit_display, numeric_result"
## [1] "Patients: 214660; Encounters: 241460"

Tests in this dataset.

Lab N
Troponin I 167280
Troponin T S/Pl 166588
Troponin 52788
Troponin I SerPl aCnc 15398
Troponin I Bld Quant 4455
Troponin I Ser/plasma DL<=0.01 ng/mL Quant 122
Title:
Lab tests in dataset, with value counts

Define biomarker[s] of interest.

## Biomarker of interest: "Troponin I"
## Biomarker of interest: "Troponin T S/Pl"

Select dataset for biomarker[s] of interest.

i labs valcount units pref_units pref_units_valcount mean median sd
1 Troponin I 167280 ng/mL ng/mL 167280 1.0339 0.02 11.0724
2 Troponin T S/Pl 166588 ng/mL, ng/dL ng/mL 166326 0.0805 0.01 0.6062
Title:
Summary of data for biomarker[s] of interest (2)
## Troponin I; N = 167280; min = 0.0000; max = 1182.9400; mean = 1.0339; median = 0.0200; sd = 11.0724
## Troponin T S/Pl; N = 166588; min = 0.0000; max = 68.3000; mean = 0.0805; median = 0.0100; sd = 0.6058

Remove extreme and likely spurious values

## [1] "Troponin T S/Pl; N = 43823; min = 0.0110; max = 0.0790; mean = 0.0283; median = 0.0200; sd = 0.0146"
Troponin T S/Pl: distribution percentiles
percentiles values
0% 0.011
10% 0.020
20% 0.020
30% 0.020
40% 0.020
50% 0.020
60% 0.020
70% 0.030
80% 0.040
90% 0.050
100% 0.079
## [1] "Columns: patient_id, patient_type_id, patient_type_desc, gender, race, ethnicity, age_mid_year, exclusion_flag, agegroup"

Patient cohort descriptive statistics

## [1] "Patients: 41331; Not-excluded: 24947 (60.4%)"
Troponin T S/Pl cohort, pre-exclusion, Gender distribution
Gender n_pt
Female 22682
Male 18639
Unknown/Invalid 10

Age distribution

## [1] "Age_mid_year: N = 24330; min = 1.0; max = 90.6; mean = 62.2; median = 63.1; sd = 18.1"
Troponin T S/Pl cohort, Age_mid_year: distribution percentiles
percentiles values
0% 0.96
10% 36.61
20% 46.21
30% 53.01
40% 58.18
50% 63.10
60% 68.69
70% 73.99
80% 79.52
90% 85.98
100% 90.56

Remove patients with unknown gender or age

## [1] "Excluding patients with unknown gender: 10 / 24947 (0.0%) excluded"
## [1] "Excluding patients with unknown agegroup: 617 / 24947 (2.5%) excluded"

Stratified statistics and distributions

Initially, for sex and age-group. First merge lab value table with stratification variables.

## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
## WARNING: multiple units: ng/dL; ng/mL
Troponin T S/Pl: Normal-physiological healthy patient cohort, stratified statistics
i sex agegroup valcount units mean median sd
1 Female 00-09 0 ng/dL; ng/mL NaN NA NA
2 Male 00-09 1 ng/dL; ng/mL 0.0100 0.010 NA
3 Female 10-19 22 ng/dL; ng/mL 0.0364 0.010 0.1214
4 Male 10-19 14 ng/dL; ng/mL 0.0100 0.010 0.0000
5 Female 20-29 230 ng/dL; ng/mL 0.0192 0.010 0.0415
6 Male 20-29 142 ng/dL; ng/mL 0.0341 0.010 0.0888
7 Female 30-39 432 ng/dL; ng/mL 0.0168 0.010 0.0444
8 Male 30-39 352 ng/dL; ng/mL 0.0244 0.010 0.0664
9 Female 40-49 789 ng/dL; ng/mL 0.0250 0.010 0.0836
10 Male 40-49 476 ng/dL; ng/mL 0.0390 0.010 0.0754
11 Female 50-59 1097 ng/dL; ng/mL 0.0162 0.010 0.0483
12 Male 50-59 1019 ng/dL; ng/mL 0.0285 0.010 0.0852
13 Female 60-69 1123 ng/dL; ng/mL 0.0285 0.010 0.0743
14 Male 60-69 810 ng/dL; ng/mL 0.0197 0.010 0.0321
15 Female 70-79 1047 ng/dL; ng/mL 0.0215 0.010 0.0538
16 Male 70-79 744 ng/dL; ng/mL 0.0315 0.010 0.0842
17 Female 80-89 935 ng/dL; ng/mL 0.0278 0.010 0.1506
18 Male 80-89 531 ng/dL; ng/mL 0.0380 0.010 0.0946
19 Female 90+ 360 ng/dL; ng/mL 0.0455 0.010 0.2404
20 Male 90+ 171 ng/dL; ng/mL 0.0453 0.015 0.1529